package cn.jdbc.mysql;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

//mysql delete
public class Test04 {
    public static void main(String[] args) throws  Exception{
    Class.forName("com.mysql.jdbc.Driver");
    String url="jdbc:mysql://localhost:3306/test";
    String name="root";
    String password="root";
        Connection connection = DriverManager.getConnection(url, name,
                password);
        Statement statement = connection.createStatement();
        int i = statement.executeUpdate("DELETE FROM `table-user`WHERE id=4;");
        if (i!=0){
            System.out.println("删除成功");
        }

    }
}
